What is the role of a capacitor in a circuit